package com.nd.controller;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.nd.common.result.ResultUtils;
import com.nd.entity.OrderDetail;
import com.nd.entity.Users;
import com.nd.service.IOrderDetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author liruirui
 * @since 2024-12-25
 */
@RestController
@RequestMapping("/order-detail")
public class OrderDetailController {

    @Autowired
    IOrderDetailService service;


    @GetMapping("/")
    public Object getList(@RequestParam Integer orderId){
        QueryWrapper queryWrapper = new QueryWrapper();
        queryWrapper.eq("order_id",orderId);
        List<OrderDetail> list = service.list(queryWrapper);
        return ResultUtils.returnSuccessLayui(list,list.size());
    }

}
